import 'dart:convert';

/// id : "8ff6583a-7f1a-4de0-b5a9-10684bc4ef39"
/// title : "New chat"
/// create_time : "2023-06-17T12:18:24.217800+00:00"
/// update_time : "2023-06-17T12:18:58+00:00"
/// mapping : null
/// current_node : null

ConversationBean conversationBeanFromJson(String str) =>
    ConversationBean.fromJson(json.decode(str));
String conversationBeanToJson(ConversationBean data) =>
    json.encode(data.toJson());

class ConversationBean {
  ConversationBean({
    String? id,
    String? title,
    String? createTime,
    String? updateTime,
    dynamic mapping,
    dynamic currentNode,
  }) {
    _id = id;
    _title = title;
    _createTime = createTime;
    _updateTime = updateTime;
    _mapping = mapping;
    _currentNode = currentNode;
  }

  ConversationBean.fromJson(dynamic json) {
    _id = json['id'];
    _title = json['title'];
    _createTime = json['create_time'];
    _updateTime = json['update_time'];
    _mapping = json['mapping'];
    _currentNode = json['current_node'];
  }
  String? _id;
  String? _title;
  String? _createTime;
  String? _updateTime;
  dynamic _mapping;
  dynamic _currentNode;
  ConversationBean copyWith({
    String? id,
    String? title,
    String? createTime,
    String? updateTime,
    dynamic mapping,
    dynamic currentNode,
  }) =>
      ConversationBean(
        id: id ?? _id,
        title: title ?? _title,
        createTime: createTime ?? _createTime,
        updateTime: updateTime ?? _updateTime,
        mapping: mapping ?? _mapping,
        currentNode: currentNode ?? _currentNode,
      );
  String? get id => _id;
  String? get title => _title;
  String? get createTime => _createTime;
  String? get updateTime => _updateTime;
  dynamic get mapping => _mapping;
  dynamic get currentNode => _currentNode;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['title'] = _title;
    map['create_time'] = _createTime;
    map['update_time'] = _updateTime;
    map['mapping'] = _mapping;
    map['current_node'] = _currentNode;
    return map;
  }
}
